package com.spring.demo.controller;

import com.spring.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller

public class UserController {
    @Autowired
    private User user;

    public void printUser() {
        System.out.println(user);
        //修改user
        User myUser = user;
        myUser.setName("jack");
        System.out.println("myUser-->" + myUser);
        System.out.println("user-->" + user);
    }
}
